<!-- Modified by Vu on 11/05/2013 -->

<div class="actions">
    	<ul>

                        		<li><?php echo $this->Html->link(__('Staff Users'), array('controller' => 'Users','action' => 'index')); ?></li>
                        		<li><?php echo $this->Html->link(__('Departments'), array('controller' => 'departments', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Contacts'), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Lists'), array('controller' => 'mail_lists', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Timesheets'), array('controller' => 'timesheets', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Notes'), array('controller' => 'notes', 'action' => 'index')); ?> </li>
                        	</ul>
    </div>

<div class="notes index">
	<h2><?php echo __('Notes'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<!--<th><?php echo $this->Paginator->sort('id'); ?></th>-->
			<th><?php echo $this->Paginator->sort('contact_id'); ?></th>
			<th><?php echo $this->Paginator->sort('user_id'); ?></th>
			<th><?php echo $this->Paginator->sort('notes'); ?></th>
			<th><?php echo $this->Paginator->sort('date_time'); ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($notes as $note): ?>
	<tr>
		<!--<td><?php echo h($note['Note']['id']); ?>&nbsp;</td>-->
		<td>
			<?php echo $this->Html->link($note['Contact']['first_name']." ".$note['Contact']['middle_name']." ".$note['Contact']['last_name'], array('controller' => 'contacts', 'action' => 'view', $note['Contact']['id'])); ?>
		</td>
		<td>
			<?php echo $this->Html->link($note['User']['user_id'], array('controller' => 'users', 'action' => 'view', $note['User']['id'])); ?>
		</td>
		<td><?php echo h($note['Note']['notes']); ?>&nbsp;</td>
		<td><?php echo h($note['Note']['date_time']); ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $note['Note']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $note['Note']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $note['Note']['id']), null, __('Are you sure you want to delete # %s?', $note['Note']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
                    		echo "<p>";
                    		$urlAdd = array('controller' => '/Notes/','action' => 'add');
                            echo $this->Form->button('Add New Note', array('onclick' => "location.href='".$this->Html->url($urlAdd)."'"));
                        ?>
            	<p>
    	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>

